    package AMainFrame;  
    import org.eclipse.swt.SWT;  
    import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;  
    import org.eclipse.swt.widgets.Display;  
    import org.eclipse.swt.widgets.Shell;  
    /** 
     *  主面板 
     */  
    public class MainApp {  
        protected Shell shell;  
        //左面板  
        static LeftCom left ;  
        //右面板  
        static RightCom right ;   
          
          
        /** 
         * Launch the application 
         * @param args 
         */  
        public static void main(String[] args) 
        {  
            try 
            {  
                MainApp window = new MainApp();  
                window.open();  
            } 
            catch (Exception e)
            {  
                e.printStackTrace();  
            }  
        }  
        /** 
         * Open the window 
         */  
        public void open() 
        {  
            final Display display = Display.getDefault();  
            createContents();  
            shell.open();  
            shell.layout();  
            while (!shell.isDisposed()) 
            {  
                if (!display.readAndDispatch())  
                    display.sleep();  
            }  
        }  
        
        protected void createContents() 
        {  
            shell = new Shell();  
            shell.setSize(1000, 700);  
            Rectangle bounds = Display.getDefault().getPrimaryMonitor().getBounds();
            Rectangle rect = shell.getBounds();
            int x = bounds.x + (bounds.width - rect.width) / 2;
            int y = bounds.y + (bounds.height - rect.height) / 2;
            shell.setLocation(x, y);
            shell.setText("分布式综合模块化航电系统架构设计");  
            //布局  
            FillLayout Buju = new FillLayout();  
            this.shell.setLayout(Buju);  
              
            //左右分栏，左边功能树、右边功能面板  
            SashForm sashForm = new SashForm(shell, SWT.HORIZONTAL);  
            sashForm.setLayout(new FillLayout());  
              
            left = new LeftCom(sashForm , SWT.NONE );  
            right = new RightCom(sashForm, SWT.NONE);
            sashForm.setWeights(new int[] {240, 700});
        }  
    }  